//using System;
//using System.Collections.Generic;
//using System.Collections.ObjectModel;
//using System.Linq.Expressions;
//using UCosmic.Domain.Establishments;

//namespace UCosmic.Domain.Email
//{
//    public class EmailTemplateFinder
//    {
//        public EmailTemplateFinder()
//        {
//            IsForInsertOrUpdate = false;
//            IsCurrent = true;
//            IsArchived = false;
//            IsDeleted = false;
//        }

//        public bool? IsCurrent { get; set; }
//        public bool? IsArchived { get; set; }
//        public bool? IsDeleted { get; set; }
//        public int? RevisionId { get; set; }
//        public Guid? EntityId { get; set; }
//        public string Name { get; set; }
//        public Establishment ForEstablishment { get; set; }
//        public bool FallBackToDefault { get; set; }

//        private List<Expression<Func<EmailTemplate, object>>> _toBeEagerLoaded;
//        public ReadOnlyCollection<Expression<Func<EmailTemplate, object>>> ToBeEagerLoaded
//        {
//            get { return (_toBeEagerLoaded != null) ? _toBeEagerLoaded.AsReadOnly() : null; }
//        }

//        public EmailTemplateFinder EagerLoad(Expression<Func<EmailTemplate, object>> expression)
//        {
//            if (expression != null)
//            {
//                if (_toBeEagerLoaded == null)
//                    _toBeEagerLoaded = new List<Expression<Func<EmailTemplate, object>>>();
//                _toBeEagerLoaded.Add(expression);
//            }
//            return this;
//        }

//        public bool IsForInsertOrUpdate { get; private set; }

//        public EmailTemplateFinder ForInsertOrUpdate()
//        {
//            IsForInsertOrUpdate = true;
//            return this;
//        }
//    }

//    public static class EmailTemplateBy
//    {
//        public static EmailTemplateFinder Name(string name, Establishment forEstablishment = null, bool fallBackToDefault = true)
//        {
//            return new EmailTemplateFinder
//            {
//                Name = name,
//                ForEstablishment = forEstablishment,
//                FallBackToDefault = fallBackToDefault,
//            };
//        }
//    }
//}